<?php

namespace app\api\model;

use think\Model;

class Article extends Model
{
    //设置主键
    protected $pk = 'article_id';
    // 关联 用户表
    public function user()
    {
        return $this->hasOne('User','user_id','article_uid')->field('article.article_id,user.user_nickname');
    }
}
